def main(str_input):
    if (len(str_input) > 0)&(len(str_input) <= 255):
        letter(str_input)
    else:
        print("您输入的字符串非法！");


def letter(str_input):
    count = 0
    str_temp=''
    for i in str_input:
        if i.isalpha():
            str_temp+=i
    reverse(str_temp)


def reverse(str_input):
    str_a = []
    for i in str_input:
        str_a.insert(0,i)

    print(''.join(str_a))
    enCode(''.join(str_a))


def enCode(str_input):
    for i in str_input:
        if ord("a") <= ord(i) <= ord("z"):
            print(chr(ord("a") + (ord(i) - ord("a") + 3)%26),end='')
        if ord("A") <= ord(i) <= ord("Z"):
            print(chr(ord("A") + (ord(i) - ord("A") + 3)%26),end='')

main(input("请输入0-255长度的字符串："))
